<?php get_instance()->view('common/header');?>
<style>
    i,div{
        -webkit-box-sizing: content-box;
        -moz-box-sizing: content-box;
        box-sizing: content-box;
    }
    .clearfix:after {
        clear: both;
    }
    .clearfix:before, .clearfix:after {
        content: " ";
        display: table;
    }
    .alieditContainer{
        position: relative;
    }

    .sixDigitPassword {
        position: absolute;
        left: -122px;
        top: 0;
        width: 1000px;
        height: 26px;
        color: #fff;
        font-size: 12px;
        -webkit-box-sizing: content-box;
        box-sizing: content-box;
        -webkit-user-select: initial;
        outline: 'none';
        z-index: 999;
        opacity:0;
        filter:alpha(opacity=0);
    }

    .sixDigitPassword-box {

        cursor:text;
        background: #fff;
        outline: none;
        position: relative;
        padding: 8px 0;
        height: 15px;
        border: 1px solid #cccccc;
        border-radius: 2px;
    }
    .sixDigitPassword-box i {
        float: left;
        display: block;
        padding: 4px 0;
        height: 7px;
        border-left: 1px solid #cccccc;
    }
    .sixDigitPassword-box .active {
        background: url('<?php echo $this->staticUrl?>img/password-blink.gif') no-repeat center center;
    }
    .sixDigitPassword-box b {
        display: block;
        margin: 0 auto;
        width: 7px;
        height: 7px;
        overflow: hidden;
        visibility:hidden;
        background: url('<?php echo $this->staticUrl?>img/passeord-dot.png') no-repeat;
    }
    .sixDigitPassword-box span {
        position: absolute;
        display: block;
        left: 0px;
        top: 0px;
        height: 30px;
        border: 1px solid rgba(82, 168, 236, .8);
        border: 1px solid #00ffff\9;
        border-radius: 2px;
        visibility: hidden;
        -webkit-box-shadow: inset 0px 2px 2px rgba(0, 0, 0, 0.75), 0 0 8px rgba(82, 168, 236, 0.6);
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
    }
    .ui-securitycore  .ui-form-item .ui-form-explain{
        margin-top: 8px;
    }
    .i-block{
        display:inline-block;
    }
    .six-password{
        position: relative;
        height:33px;
        width:182px;
        overflow: hidden;
        vertical-align: middle;
        margin-bottom: 1em;
    }
    #payPassword_rsainput-error{
        font-size: 0.8em;
    }
</style>
<body class="bag3">
<div class="statebox chuizhi bor_bb p20_0 bag1">
    <img class="stateimg" src="<?php echo $this->staticUrl?>img/png/pic26.png" alt="">
    <span class="f11">订单提交成功</span>
</div>
<div class="itemline"></div>
<!-- <div class="bor_bt">
    <label for="f01">
        <div  class="f12 ml5 bor_bb heng vCenter itemitemn">
            <div class="left f08 vCenter"><span><img class="lefttitleimg mr5 di mbmin" src="img/png/pic27.png" alt="">微信支付</span></div>
            <div class="right f09 cor6 vCenter"><img class="lefttitleimg mr5 di mbmin" src="img/png/pic31.png" alt=""></div>
        </div>
    </label>
    <div  class="f12 ml5 bor_bb heng vCenter itemitemn">
        <div class="left f08 vCenter"><span><img class="lefttitleimg mr5 di mbmin" src="img/png/pic28.png" alt="">支付宝支付</span></div>
        <div class="right f09 cor6 vCenter"><img class="lefttitleimg mr5 di mbmin" src="img/png/pic30.png" alt=""></div>
    </div>
    <div  class="f12 ml5 heng vCenter itemitemn">
        <div class="left f08 vCenter"><span><img class="lefttitleimg mr5 di mbmin" src="img/png/pic29.png" alt="">余额支付（可用余额：￥231.00）</span></div>
        <div class="right f09 cor6 vCenter"><img class="lefttitleimg mr5 di mbmin" src="img/png/pic31.png" alt=""></div>
    </div>
</div> -->
<div class="weui-cells weui-cells_radio mt0">
    <label class="weui-cell weui-check__label" for="x11">
        <div class="weui-cell__hd"><img class="heightimg mr5" src="<?php echo $this->staticUrl?>img/png/pic27.png" alt=""></div>
        <div class="weui-cell__bd">
            <p class="f09">微信支付</p>
        </div>
        <div class="weui-cell__ft">
            <input type="radio" class="weui-check" name="radio1" id="x11" checked="checked" value="2"/>
            <span class="weui-icon-checked"></span>
        </div>
    </label>
<!--    <label class="weui-cell weui-check__label" for="x12">-->
<!--        <div class="weui-cell__hd"><img class="heightimg mr5" src="--><?php //echo $this->staticUrl?><!--img/png/pic28.png" alt=""></div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <p class="f09">支付宝支付</p>-->
<!--        </div>-->
<!--        <div class="weui-cell__ft">-->
<!--            <input type="radio" class="weui-check" name="radio1" id="x12" value="3"/>-->
<!--            <span class="weui-icon-checked"></span>-->
<!--        </div>-->
<!--    </label>-->
    <label class="weui-cell weui-check__label" for="x13">
        <div class="weui-cell__hd"><img class="heightimg mr5" src="<?php echo $this->staticUrl?>img/png/pic29.png" alt=""></div>
        <div class="weui-cell__bd">
            <p class="f09">余额支付<span class="f10 cor6">（可用余额：￥<?php echo $this->userBalance?>）</span></p>
        </div>
        <div class="weui-cell__ft">
            <input type="radio" class="weui-check" name="radio1" id="x13" value="1"/>
            <span class="weui-icon-checked"></span>
        </div>
        <input type='hidden' name="payment" value="2">
    </label>
</div>
<div class="heng p3p pr10 f10">
    <span class="f09 cor6"></span>
    <span class="hongzi f09">待支付：￥<?php echo $info['amount']?></span>
</div>
<button class="kbtn" id="orderPay" >立即支付</button>
<?php get_instance()->view('common/dialog');?>
</body>
<script src="<?php echo $this->staticUrl?>js/jquery-validate.js" type="text/javascript"></script>
<script src="<?php echo $this->staticUrl?>js/base.js"></script>
<script src="<?php echo $this->staticUrl?>js/validate.js" type="text/javascript"></script>
<script type="text/javascript">
    //调用微信JS api 支付
    function jsApiCall()
    {
        var url = '<?php echo $info['url']; ?>';
        WeixinJSBridge.invoke(
            'getBrandWCPayRequest',
            <?php echo $jsApiParameters; ?>,
            function(res){
                if(res.err_msg == "get_brand_wcpay_request:ok"){
                    show_message({status:1, message:'支付成功'});
                    window.location.href = url;
                    return false;
                }else{
                    if(res.err_msg == "get_brand_wcpay_request:cancel"){
                        show_message({status:0, message:'取消支付'});
                    }else if(res.err_msg == "get_brand_wcpay_request:fail"){
                        show_message({status:0, message:'支付失败'});
                    }
                    window.location.href = url;
                    return false;
                }
            }
        );
    }

    function callpay()
    {

        if (typeof WeixinJSBridge == "undefined"){
            if( document.addEventListener ){
                document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
            }else if (document.attachEvent){
                document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
            }
        }else{
            jsApiCall();
        }
    }
</script>
<script type="text/javascript">
    var $iosDialog1 = $('#iosDialog1'),
        payPassword = $("#payPassword_container"),
        _this = payPassword.find('i');
    var payCode = '<?php echo $info['code']?>';

    $(function () {
        $(".weui-check").click(function(){
            $("[name='payment']").val($(this).val());
        })
        $('#orderPay').click(function () {
            var payType = $("[name='payment']").val();
            
            if (!payType){
                show_message({status:0, message:'请选择支付方式'});
                return false;
            }
            if (payType == 2){
                if (typeof WeixinJSBridge == "undefined"){
                    if( document.addEventListener ){
                        document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                    }else if (document.attachEvent){
                        document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                        document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                    }
                }else{
                    jsApiCall();
                }
            }else{
                $iosDialog1.fadeIn(200);
                _this.eq(0).addClass("active");
                $('#cardwrap').css({'visibility':'hidden',"left":"0"});
                _this.removeClass("active");
                _this.eq(0).addClass("active");
                _this.find("b").css('visibility','hidden');
                $("#payPassword_container").find("i").removeClass("active");
                $("#payPassword_rsainput").val('');
                $("#payPassword_rsainput").focus();
            }
        });

        /**
         * 取消
         */
        $iosDialog1.find(".weui-dialog__btn_default").on('click', function () {
            $(this).parents('.js_dialog').fadeOut(200);
        });

        /**
         * 确定
         */
        $iosDialog1.find(".weui-dialog__btn_primary").on('click', function () {
            var value = $("#payPassword_rsainput").val();
            $(this).parents('.js_dialog').fadeOut(200);//密码
//            console.log(value)
            blockUI.show('支付中');
            $.post("<?php echo getUrl('pay/balance')?>",{pay_code:payCode,pay_passwd:value},function(data){
                data = JSON.parse(data);
//                console.log(data)
                if(data.status == 1){
                    show_message(data);
                    blockUI.hide();
                    window.location.href = data.url
                }else{
                    show_message(data);
                    blockUI.hide();
                }
            }).error(function(){

            })
        });
    })

</script>


</html>